<?php
/**
 * @file test2.php Trackback提交测试2
 * @package 
 * @subpackage 
 * @version $id: 0.1 UTF-8 2009-2-25 下午03:56:11 $
 * @author LD King (mifunny.info)
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 */
set_include_path( get_include_path(). PATH_SEPARATOR.'/home/kldscs/pear/php' );
?>
<?php 
$trackbackData = array(
	array(
	'title' => 'NO.1 Trackback Test by LD ',
	'excerpt' => '[...]If you can see this, don\'t tell others! My Friends.[...]',
	'url' => 'http://mifunny.info/friends',
	'blog_name' => 'LD\'s Notepad',
	'charset' => 'UTF-8',
	'trackback_url' => 'http://mifunny.info/the-three-group-code-of-send-trackback-directly-231.html/trackback'
	),
	
	array(
	'title' => 'NO.2 Trackback Test by LD ',
	'excerpt' => '[...]If you can see this, don\'t tell others! GUEST BOOK MAN[...]',
	'url' => 'http://mifunny.info/guestbook',
	'blog_name' => 'LD\'s Notepad',
	'charset' => 'UTF-8',
	'trackback_url' => 'http://mifunny.info/the-three-group-code-of-send-trackback-directly-231.html/trackback'
	),
	
	array(
	'title' => 'NO.3 Trackback Test by LD ',
	'excerpt' => '[...]If you can see this, don\'t tell others! BLOGROLL ANS OTHER LINKS[...]',
	'url' => 'http://mifunny.info/blogroll',
	'blog_name' => 'LD\'s Notepad',
	'charset' => 'UTF-8',
	'trackback_url' => 'http://mifunny.info/the-three-group-code-of-send-trackback-directly-231.html/trackback'
	),
	
	array(
	'title' => 'NO.4 Trackback Test by LD ',
	'excerpt' => '[...]If you can see this, don\'t tell others! SHARE GOOD BOOKS[...]',
	'url' => 'http://mifunny.info/sharebooks',
	'blog_name' => 'LD\'s Notepad',
	'charset' => 'UTF-8',
	'trackback_url' => 'http://mifunny.info/the-three-group-code-of-send-trackback-directly-231.html/trackback'
	),	

	array(
	'title' => 'NO.5 Trackback Test by LD ',
	'excerpt' => '[...]If you can see this, don\'t tell others! SITEMAP of MIFUNNY.INFO[...]',
	'url' => 'http://mifunny.info/mysitemap',
	'blog_name' => 'LD\'s Notepad',
	'charset' => 'UTF-8',
	'trackback_url' => 'http://mifunny.info/the-three-group-code-of-send-trackback-directly-231.html/trackback'
	),	

	array(
	'title' => 'NO.6 Trackback Test by LD ',
	'excerpt' => '[...]If you can see this, don\'t tell others! ABOUT MIFUNNY.INFO, ABOUT LD[...]',
	'url' => 'http://mifunny.info/about',
	'blog_name' => 'LD\'s Notepad',
	'charset' => 'UTF-8',
	'trackback_url' => 'http://mifunny.info/the-three-group-code-of-send-trackback-directly-231.html/trackback'
	)	
	);

// include class
include "Services/Trackback.php";

// initialize new instance 
$trackback = new Services_Trackback();

// set object properties
for ($i=0; $i<count($trackbackData); $i++){
	foreach ($trackbackData[0] as $k => $v) {
  		$trackback->set($k, $v);
	}
	sleep(5);
	// send trackback
	$ret = $trackback->send();
	if (PEAR::isError($ret)) {
	  echo "<br />ERROR. Trackback failed because: " . $ret->getMessage();
	} else {
	  echo "<br />Trackback successfully posted".$trackbackData[0]['url'];
	}
}//END for 

?>